﻿<!DOCTYPE html>
<html lang="ch">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<meta http-equiv = "pragma" content = "no-cache">
<meta http-equiv = "Cache-Control" content = "no-cache,must-revalidate">
<meta http-equiv = "expires" content = "0">
<title>淘车网-优质二手车交易平台</title>
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="css/reality-icon.css">
<link rel="stylesheet" type="text/css" href="css/bootsnav.css">
<link rel="stylesheet" type="text/css" href="css/jquery.fancybox.css">
<link rel="stylesheet" type="text/css" href="css/owl.carousel.css">
<link rel="stylesheet" type="text/css" href="css/owl.transitions.css">
<link rel="stylesheet" type="text/css" href="css/cubeportfolio.min.css">
<link rel="stylesheet" type="text/css" href="css/settings.css">
<link rel="stylesheet" type="text/css" href="css/range-Slider.min.css">
<link rel="stylesheet" type="text/css" href="css/search.css">
<link rel="stylesheet" type="text/css" href="css/style.css">
<link rel="icon" href="">

</head>
<body> 

<!--Header-->
<header class="layout_default">

  <nav class="navbar navbar-default navbar-sticky bootsnav">
    <div class="container">
      <div class="row">
        <div class="col-md-12">
          <!-- Start Header Navigation -->
          <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-menu">
            <i class="fa fa-bars"></i>
            </button>
          </div> <!-- End Header Navigation -->
          <div class="collapse navbar-collapse" id="navbar-menu">
          </div>
        </div>
      </div>
    </div>
  </nav>
</header>
<!--Header Ends-->




<!-- Property Detail -->
<section id="property" class="padding">
  <div class="container">
    <div class="row">
      <div class=" slider" style="width:425px;height:200px;float:left;" id="Pic">
    </div>
    
	  <div class=" listing1 property-details" style="width:640px;height:400px;float:right;">
	  <h2>&ensp;</h2><h4>&ensp;</h4>
	  <div class="agent_wrap" id="title"></h3></div><div>
<button type="submit" class="border_radius btn-yellow text-uppercase" onclick="showOw()">查 看 电 话 号 码</button>	

</div></div></div>
	<div class="row">
      <div class="col-md-10 listing1 property-details">
        <h2>&nbsp;</h2>
        <h2 class="text-uppercase">车辆基本信息</h2>
        <h3>&nbsp;</h3>
 <div class="row property-d-table bottom40" id="base_info">
          
        </div>
		        <h2 class="text-uppercase">车主描述</h2><h3>&nbsp;</h3>
		         <div class="cbp-item">
            <div class="cbp-caption-defaultWrap">
               <div class="testinomial_box">
                  <div class="testinomial_desc blue_dark" id="description">
                  </div>
                  <div class="testinomial_author">
                  </div>
               </div>
            </div>
         </div>
         
        <h2 class="text-uppercase">车辆照片</h2><h3>&nbsp;</h3>
        <div id="detailPic">
        </div>
        
            <h2 class="text-uppercase">店铺信息</h2><h1>&nbsp;</h1><h1>&nbsp;</h1><h3>&nbsp;</h3>  
          <div class="listing_full_bg">
            <div class="listing_inner_full"id="salerInfo">
            </div>
          </div>
        
    </div></div>	

</section>
<!--  Property Detail End -->


<!--Footer-->
<footer class="footer_third">

  <div class="container padding_top">
    
    <!--CopyRight-->
    <div class="copyright_simple">
      <div class="row">
        <div class="col-md-6 col-sm-5 top20 bottom20">
          <p>Copyright &copy; 2020 <span>TaoCheNet</span>. All rights reserved.</p>
        </div>
        <div class="col-md-6 col-sm-7 text-right top15 bottom10">
          <ul class="social_share">
            <li><a href="#." class="facebook"><i class="icon-facebook-1"></i></a></li>
            <li><a href="#." class="twitter"><i class="icon-twitter-1"></i></a></li>
            <li><a href="#." class="google"><i class="icon-google4"></i></a></li>
            <li><a href="#." class="linkden"><i class="fa fa-linkedin"></i></a></li>
            <li><a href="#." class="vimo"><i class="icon-vimeo3"></i></a></li>
          </ul>
        </div>
      </div>
    </div>
  </div>
</footer>



<script src="js/jquery-2.1.4.js"></script> 
<script src="js/bootstrap.min.js"></script> 
<script src="js/jquery.appear.js"></script>
<script src="js/jquery-countTo.js"></script>
<script src="js/bootsnav.js"></script>
<script src="js/masonry.pkgd.min.js"></script>
<script src="js/jquery.parallax-1.1.3.js"></script>
<script src="js/jquery.cubeportfolio.min.js"></script>
<script src="js/range-Slider.min.js"></script>
<script src="js/owl.carousel.min.js"></script> 
<script src="js/selectbox-0.2.min.js"></script>
<script src="js/zelect.js"></script>
<script src="js/jquery.fancybox.js"></script>
<script src="js/jquery.themepunch.tools.min.js"></script>
<script src="js/jquery.themepunch.revolution.min.js"></script>
<script src="js/revolution.extension.actions.min.js"></script>
<script src="js/revolution.extension.layeranimation.min.js"></script>
<script src="js/revolution.extension.navigation.min.js"></script>
<script src="js/revolution.extension.parallax.min.js"></script>
<script src="js/revolution.extension.slideanims.min.js"></script>
<script src="js/revolution.extension.video.min.js"></script>
<script src="js/custom.js"></script>
<script src="js/functions.js"></script>
<script type="text/javascript">
			window.onload = function() {	
				var action = "/getUserInfo";
				$.get(
								action,
								function(data) {
									var user_info = data;
									var old = '';
									if(user_info.name==null||user_info.userTypeId != '2'){
										window.location.href='login.html';
									} else {
										old += '<ul class="nav navbar-nav" data-in="fadeIn" data-out="fadeOut"><li><a href="admin_main.html">商家首页</a></li>'
											+'<li class="dropdown megamenu-fw active"><a href="on_sale.html">在售车辆</a></li><li><a href="my_order.html">我的订单</a></li><li><a href="javascript:void(0);" onclick="logout()">退出登录</a></li></ul>';
										$("#navbar-menu").html(old);
									}
								});
			};
		</script>

<script type="text/javascript">
	
	       var query = window.location.search.substring(1);
	       var pid = -1;
	       var vars = query.split("&");
	       for (var i=0;i<vars.length;i++) {
	               var pair = vars[i].split("=");
	               if(pair[0] == "pid"){
	            	   pid = pair[1];
	            	   }
	       }
		var url = "/getDetails?pid=" + pid;
		$.get(
				url,
				function(data) {
					var car_info = data;
					var licheng = car_info.licheng;
					var shangpai = car_info.shangpai.substr(0,7);
					var pailiang = car_info.pailiang;
					var paifang = car_info.paifang;
					if(car_info.licheng>10000){
						licheng = ""+car_info.licheng/10000+"万";
					}
					if(pailiang.indexOf('.')==1){
						pailiang = pailiang+"L";
					}
					if(paifang==null||paifang==undefined||paifang==''){
						paifang = "--";
					}
						var old = $("#title").html();
						$("#title").html(
								old + "<h2 class=\"text-uppercase\">"
								+ car_info.name
								+"</h2><p class=\"bottom30\" ><br>"
								+"</p><table class=\"agent_contact table\" ><tbody><tr class=\"bottom10\"><th><strong>里程:</strong></th><th><strong>首次上牌:</strong></th><th><strong>排量:</strong></th><th><strong>变速箱:</strong></th><th><strong>排放标准:</strong></th></tr><tr class=\"bottom10\"><td class=\"text-left\"><span>"
								+ licheng
								+"</span>公里</td><td class=\"text-left\">"
								+ shangpai
								+"</td><td class=\"text-left\">"
								+ pailiang
								+"</td><td class=\"text-left\">"
								+ car_info.biansuxiang
								+"</td><td class=\"text-left\">"
								+ paifang
								+"</td></tr></tbody></table><table class=\"agent_contact table\"><tbody><tr class=\"bottom10\"><td><span style=\"font-size:40px;color:#F00\" id=\"price\">"
								+ car_info.price
								+"</span><span style=\"font-size:20px;color:#F00\">万</span> &nbsp;&nbsp;&nbsp;&nbsp;</td></tr><tr class=\"bottom10\"></tr></tbody></table>");
						var licheng = car_info.licheng;
						var shangpai = car_info.shangpai.substr(0,7);
						var xingzhi = car_info.xingzhi;
						var shangyexian = car_info.shangyexian.substr(0,7);
						var jiaoqiangxian = car_info.jiaoqiangxian.substr(0,7);
						var nianjian = car_info.nianjian.substr(0,7);
						var paifang = car_info.paifang;
						var pailiang = car_info.pailiang;
						var qigang = "--"
						
						if(pailiang.indexOf('.')==1){
							qigang = "L";
						}
						if(paifang==null||paifang==undefined||paifang==''){
							paifang = "--";
						}					
						if(car_info.licheng>10000){
							licheng = ""+car_info.licheng/10000+"万";
						}
						if(xingzhi==null||xingzhi==undefined||xingzhi==''){
							xingzhi = "--";
						}
							var old = $("#base_info").html();
							$("#base_info").html(
									old + "<div class=\"col-md-4 col-sm-4 col-xs-12\"><span><strong>基本参数</strong></span><h4>&ensp;</h4><table class=\"table table-striped table-responsive\"><tbody><tr><td><b>上牌时间</b></td><td class=\"text-left\">"
	+ shangpai
	+"</td></tr><tr><td><b>表显里程</b></td><td class=\"text-left\">"
	+ licheng
	+"公里</td></tr><tr><td><b>车辆性质</b></td><td class=\"text-left\">"
	+ xingzhi
	+"</td></tr><tr><td><b>商业险到期</b></td><td class=\"text-left\">"
	+ shangyexian
	+"</td></tr><tr><td><b>年检到期</b></td><td class=\"text-left\">"
	+ nianjian
	+"</td></tr><tr><td><b>维修保养</b></td><td class=\"text-left\">"
	+ car_info.baiyang
	+"</td></tr><tr><td><b>交强险到期</b></td><td class=\"text-left\">"
	+ jiaoqiangxian
	+"</td></tr><tr><td><b>变速箱</b></td><td class=\"text-left\">"
	+ car_info.biansuxiang
	+"</td></tr><tr><td><b>车辆VIN码</b></td><td class=\"text-left\">"
	+ car_info.VIN
	+"</td></tr></tbody></table></div><div class=\"col-md-4 col-sm-4 col-xs-12\"><span><strong>发动机参数</strong></span><h4>&ensp;</h4><table class=\"table table-striped table-responsive\"><tbody><tr><td><b>本车排量</b></td><td class=\"text-left\">"
	+ pailiang
	+"</td></tr><tr><td><b>排放标准</b></td><td class=\"text-left\">"
	+paifang
	+"</td></tr><tr><td><b>进气形式</b></td><td class=\"text-left\">"
	+ car_info.jingqi
	+"</td></tr><tr><td><b>气缸</b></td><td class=\"text-left\">"
	+ qigang
	+"</td></tr><tr><td><b>最大功率</b></td> <td class=\"text-left\">"
	+ car_info.gonglv
	+"</td></tr><tr><td><b>最大扭矩</b></td><td class=\"text-left\">"
	+ ""
	+"</td></tr><tr><td><b>燃料类型</b></td><td class=\"text-left\">"
	+ ""
	+"</td> </tr><tr><td><b>油耗</b></td><td class=\"text-left\">"
	+ car_info.youhao
	+"</td></tr><tr><td><b>供油方式</b></td><td class=\"text-left\"></td></tr></tbody></table></div><div class=\"col-md-4 col-sm-4 col-xs-12\"><span><strong>车身参数</strong></span><h4>&ensp;</h4><table class=\"table table-striped table-responsive\"><tbody><tr><td><b>长*宽*高</b></td><td class=\"text-left\"></td></tr><tr><td><b>轴距 (mm)</b></td><td class=\"text-left\"></td></tr><tr><td><b>驱动方式</b></td><td class=\"text-left\">"
	+ car_info.qudong
	+"</td></tr><tr><td><b>整备质量 (kg)</b></td><td class=\"text-left\">5</td></tr><tr><td><b>行李箱容积 (L)</b></td><td class=\"text-left\"></td></tr><tr><td><b>座位数</b></td><td class=\"text-left\""
	+ car_info.jiegou.substr(0,2)
	+"</td></tr><tr><td><b>车门数</b></td><td class=\"text-left\">"
	+ car_info.jiegou.substr(2,4)
	+"</td></tr><tr><td><b>&ensp;</b></td><td class=\"text-left\">&ensp;</td></tr><tr><td><b>&ensp;</b></td><td class=\"text-left\">&ensp;</td></tr></tbody></table></div>");
							var miaoshu = car_info.miaoshu.substr(5,car_info.miaoshu.length);
							var old = $("#description").html();
							$("#description").html(
									old + "<p style=\"font-size:20px;\"><strong>车况描述：</strong></p><div><p>"
									+ miaoshu
									+ "</p></div><img src=\"images/quote.png\" alt=\"quote\" class=\"quote\">");
						});
		var url = "/getDetailsPic?pid=" + pid;
		$.get(
				url,
				function(data) {
					var list = data;
					var str = $("#detailPic").html();
					var str3 ="";
					for(i in list){
						var item = list[i];
						
						if(i==0){
							str3 += '<input type="radio" name="slide_switch" id="id1" checked="checked"/><label for="id1"><img src="'+ item.src
							+'" width="60" /></label><img src="'+ item.src
							+'"/>';
						}
						
						if(i>0&&i<5){
						str3 += '<input type="radio" name="slide_switch" id="id'+(i+1)
						+'" /><label for="id'+(i+1)
						+'"><img src="'+ item.src
						+'" width="60" /></label><img src="'+ item.src
						+'"/>';
					}
						if(i%2==0){
							str += "<div class=\"row bottom40\"><div class=\"col-md-6 col-sm-6 col-xs-12\"><div class=\"pro-img\"><figure class=\"wpf-demo-gallery\"><img src=\""
							+ item.src
							+"\" alt=\"image\"/><figcaption class=\"view-caption\"><a data-fancybox-group=\"gallery\" class=\"fancybox\" href=\""
							+ item.src
							+"\"><i class=\"icon-focus\"></i></a></figcaption></figure></div></div>";
						}
						else{
							str +="<div class=\"col-md-6 col-sm-6 col-xs-12\"><div class=\"pro-img\"><figure class=\"wpf-demo-gallery\"><img src=\""
								+ item.src
								+"\" alt=\"image\"/><figcaption class=\"view-caption\"><a data-fancybox-group=\"gallery\" class=\"fancybox\" href=\""
								+ item.src
								+"\"><i class=\"icon-focus\"></i></a></figcaption></figure></div></div></div>";
						}
								}
					if(list.length%2!=0){
						str +="</div>";
					}
					$("#detailPic").html(str);
					$("#Pic").html(str3);

						});
		
		var action = "/getSalerInfo?pid=" + pid;
		$.get(
				action,
				function(data) {
					var car_business = data;
						var old = $("#salerInfo").html();
						$("#salerInfo").html(
								old +  "<span style=\"font-size:15px;\">"
								+ car_business.huiyuan
								+"&nbsp;</span><a href=\"#.\"><h3>"
								+ car_business.sname
								+"</h3><h4>&nbsp;</h4><div><p>&ensp;&ensp;&ensp;&ensp;"
								+ car_business.describe
								+"</p></div><h4>&nbsp;</h4></a><div class=\"favroute clearfix\"><div class=\"property_meta\"><span><strong>好评率：</strong>"
								+ car_business.haoping
								+"%</span><span><strong>在售：</strong>"
								+ car_business.zaishou
								+"</span><span><strong>已售：</strong>"
								+ car_business.yishou
								+"</span></div></div>");
						});
		action = "/getUserInfo";
		$.get(
			action,
			function(data) {
				var item = data;
				var old = '';
				if(item.name==null||item.userTypeId != '3'){
					old += '<ul class="nav navbar-nav" data-in="fadeIn" data-out="fadeOut"><li><a href="index.html">首页</a></li><li class="dropdown megamenu-fw active"><a href=#>宝贝详情</a></li><li><a href="login.html">登录/注册</a></li></ul>';
				}
				else{
					old += '<ul class="nav navbar-nav" data-in="fadeIn" data-out="fadeOut"><li><a href="index.html">首页</a></li><li class="dropdown megamenu-fw active"><a href=#>宝贝详情</a></li><li><a href="userInfo.html">个人中心</a></li><li><a href="javascript:void(0);" onclick="logout()">退出登录</a></li></ul>';
				}
				$("#navbar-menu").html(old);
				}
		);
		
	function showOw(){
		var url = "/inquirePost?pid=" + pid;
		$.get(
				url,
				function(data) {
					alert('电话号码：'+data);
				});
	}
	function logout(){
		var url = '/logout';
		$.get(
				url,
				function(data) {
				if(data==1){
					window.location.reload();
				}
				if(data==0){
					alert('退出有误！');
				}
				}
				);
	};
</script>
</body>
</html>

